<!-- index.html -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <title>学习双向通信</title>
</head>

<body>
<p id="cotnent" style="margin-top: 50px">Hello World</p>
<br>
<button id="btn">调用应用端的函数</button>

<script>
    function htmlTest(msg) {
      document.getElementById('cotnent').innerHTML = msg.toUpperCase()
      return 'Web中的JS返回给应用端的数据'
    }

    document.getElementById('btn').addEventListener('click', function () {
      /*Web端调用应用端的函数*/
      atguigu.fn1('aaa')
      const result = atguigu.fn2('bbb')
      document.getElementById('cotnent').innerHTML = result
    })
</script>
</body>
</html>